package com.wash.shoes.request;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

import com.ruoyi.common.core.domain.model.BaseModel;
import com.wash.shoes.entity.FactoryshelvesPo;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 货架请求对象
 */
@Data
public class FactoryShelvesRequest extends BaseModel {
    @ApiModelProperty(value = "货架ID")
    private String id;
    /**
     * 货架前缀
     */
    @NotNull(message = "货架前缀不能为空")
    @ApiModelProperty(value = "货架前缀")
    private String prefix;

    /**
     * 容量
     */
    @NotNull(message = "容量不能为空")
    @ApiModelProperty(value = "容量")
    @Min(value = 1, message = "容量不能小于1")
    private Integer capacity;
    /**
     * 工厂id
     */
    @ApiModelProperty(value = "工厂id")
    @NotNull(message = "工厂id不能为空")
    private String factoryId;

    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    private String remark;

    public FactoryshelvesPo toPo() {
        FactoryshelvesPo factoryshelvesPo = new FactoryshelvesPo();
        factoryshelvesPo.setId(id);
        factoryshelvesPo.setPrefix(prefix);
        factoryshelvesPo.setCapacity(capacity);
        factoryshelvesPo.setFactoryId(factoryId);
        factoryshelvesPo.setRemark(this.remark);
        return factoryshelvesPo;
    }
}
